#ifndef _WX_FS_MEM_H_
#define _WX_FS_MEM_H_

#include "wx/defs.h"
#include "wx/filesys.h"

#if wxUSE_GUI
class wxBitmap;
class wxImage;
#endif

class wxMemoryFSHandlerBase : public wxFileSystemHandler {
  public:
    wxMemoryFSHandlerBase();
    virtual ~wxMemoryFSHandlerBase();

    static void AddFile( const wxString& filename, const wxString& textdata );
    static void AddFile( const wxString& filename, const void *binarydata, size_t size );
    static void AddFileWithMimeType( const wxString& filename,
                                     const wxString& textdata,
                                     const wxString& mimetype );
    static void AddFileWithMimeType( const wxString& filename,
                                     const void *binarydata, size_t size,
                                     const wxString& mimetype );


    static void RemoveFile( const wxString& filename );

    virtual bool CanOpen( const wxString& location );
    virtual wxFSFile* OpenFile( wxFileSystem& fs, const wxString& location );
    virtual wxString FindFirst( const wxString& spec, int flags = 0 );
    virtual wxString FindNext();

  protected:
    static bool CheckHash( const wxString& filename );
    static wxHashTable *m_Hash;
};

#if wxUSE_GUI

class wxMemoryFSHandler : public wxMemoryFSHandlerBase {
  public:



    static void AddFile( const wxString& filename, const wxString& textdata ) {
      wxMemoryFSHandlerBase::AddFile( filename, textdata );
    }

    static void AddFile( const wxString& filename,
                         const void *binarydata,
                         size_t size ) {
      wxMemoryFSHandlerBase::AddFile( filename, binarydata, size );
    }
    static void AddFileWithMimeType( const wxString& filename,
                                     const wxString& textdata,
                                     const wxString& mimetype ) {
      wxMemoryFSHandlerBase::AddFileWithMimeType( filename,
          textdata,
          mimetype );
    }
    static void AddFileWithMimeType( const wxString& filename,
                                     const void *binarydata, size_t size,
                                     const wxString& mimetype ) {
      wxMemoryFSHandlerBase::AddFileWithMimeType( filename,
          binarydata, size,
          mimetype );
    }

    #if wxUSE_IMAGE
    static void AddFile( const wxString& filename,
                         const wxImage& image,
                         long type );

    static void AddFile( const wxString& filename,
                         const wxBitmap& bitmap,
                         long type );
    #endif

};

#else

class wxMemoryFSHandler : public wxMemoryFSHandlerBase {
};

#endif

#endif
